﻿using Microsoft.AspNetCore.Mvc;
using StackExchange.Redis;
using System.Diagnostics;
using TeachlyQBank.DbPool;
using TeachlyQBank.Models;
using NLog;

namespace TeachlyQBank.Controllers
{
    public class HomeController : Controller
    {
        private readonly MySqlConnectionAdapter _mysql;
        private readonly OracleConnectionAdapter _oracle;
        private readonly SqlServerConnectionAdapter _sqlServer;
        private readonly IConnectionMultiplexer _redis;
        private readonly Logger _logger;

        public HomeController(MySqlConnectionAdapter mysql,OracleConnectionAdapter oracle,SqlServerConnectionAdapter sqlServer,IConnectionMultiplexer redis)
        {
            _logger = LogManager.GetCurrentClassLogger();
            _mysql = mysql;
            _oracle = oracle;
            _sqlServer = sqlServer;
            _redis = redis;
        }

        public IActionResult Index()
        {
            return View();
        }

        public IActionResult Privacy()
        {
            return View();
        }

        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
        public IActionResult Error()
        {
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        }
    }
}